#include"processBar.h"

typedef void (*callback_t)(int);//函数指针类型,传入时传入函数名即可

void download(callback_t cb)
{ 
    int curr=0;
    int total=1000;
    while(curr<=total)
    {
        usleep(50000);
        int rate=curr*100/total;
        cb(rate);
        curr+=10;
    }
    printf("\n");
}

int main()
{
    download(processbar);
    return 0;
}
